﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using QLTV_BLL;
using QLTV_Public;

namespace QLTV_GiaoDien
{
    public partial class frm_ThongKeChiTiet_ViPham : DevExpress.XtraEditors.XtraForm
    {
        public frm_ThongKeChiTiet_ViPham()
        {
            InitializeComponent();
        }
        private string _TenLop;

        public string TenLop
        {
            get { return _TenLop; }
            set { _TenLop = value; }
        }
        ThongKe_BLL thongKe_bll = new ThongKe_BLL();
        private void frm_ThongKeChiTiet_ViPham_Load(object sender, EventArgs e)
        {
            cob_TenLop.Text = TenLop;
            Lop_Public lop = new Lop_Public();
            lop.TenLop = cob_TenLop.Text;
            gridControl1.DataSource = thongKe_bll.chitiet_ThongKe_ViPham(lop);
        }

        private void cob_TenLop_Click(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();
            string sql = "select * from tbl_Lop";
            dt = thongKe_bll.TaoBang(sql);
            cob_TenLop.DataSource = dt;
            cob_TenLop.DisplayMember = "TenLop";
        }

        private void cob_TenLop_TextChanged(object sender, EventArgs e)
        {
            Lop_Public lop = new Lop_Public();
            lop.TenLop = cob_TenLop.Text;
            gridControl1.DataSource = thongKe_bll.chitiet_ThongKe_ViPham(lop);
        }

        private void bbi_Thoat_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            this.Close();
        }

        private void bbi_In_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            gridControl1.ShowPrintPreview();
        }
    }
}